package com.um.jdy.platform.activity.controller;

import com.um.jdy.common.activity.entity.dto.CouponsGoodsDTO;
import com.um.jdy.common.activity.entity.po.CouponsGoods;
import com.um.jdy.common.activity.entity.vo.CouponsGoodsVO;
import com.um.jdy.common.activity.service.CouponsGoodsService;
import com.um.jdy.platform.activity.entity.dto.CouponsGoodsListDTO;
import com.um.jdy.platform.activity.entity.dto.CouponsGoodsPageDTO;
import com.um.jdy.platform.activity.entity.vo.CouponsGoodsListVO;
import com.um.jdy.platform.activity.manager.CouponsGoodsManager;
import com.um.springboot.starter.annotation.ApiPermission;
import com.um.springboot.starter.annotation.TokenRequired;
import com.um.springboot.starter.orm.controller.BasePlusController;
import com.um.springboot.starter.orm.entity.Response;
import com.um.springboot.starter.orm.params.ListDTO;
import com.um.springboot.starter.orm.params.PageDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 控制器：优惠券商品关联表
 */
@RestController
@RequestMapping("/api/v1/activity/coupons_goods")
@Api(tags = "CouponsGoodsController", description = "优惠券商品关联表")
@ApiPermission("coupons_goods")
@TokenRequired
public class CouponsGoodsController extends BasePlusController<CouponsGoodsManager, CouponsGoodsService, CouponsGoods, CouponsGoodsDTO, CouponsGoodsVO, CouponsGoodsPageDTO, CouponsGoodsListDTO> {

    @ApiPermission("list")
    @ApiOperation("优惠券商品列表")
    @PostMapping("get_list")
    public Response<List<CouponsGoodsListVO>> getList(@RequestBody CouponsGoodsListDTO couponsGoodsListDTO) {
        return Response.success(manager.getList(couponsGoodsListDTO));
    }
}
